<?php
/**
 * Created by PhpStorm.
 * User: lili
 * Date: 2018/12/30
 * Time: 19:16
 */

namespace system;


use system\core\config\Config;
use system\core\model\Connection;
use system\core\route\Dispatch;
use system\core\route\Load;
use system\core\route\Route;
use system\library\Cache;
use system\library\Cookie;
use system\library\Session;



class App
{
    public static function run(){
        require LIB_PATH . 'Psr4AutoloaderClass.php';
        require CORE_PATH . 'route'.DS.'Load.php';
        require SYSTEM_PATH . 'core'.DS.'config'.DS.'Config.php';
//        require "/var/local/mylamp/www/myframework/system/core/route/Dispatch.php";
        Config::load();//加载配置文件
        Load::getInstance();//加载命名空间
        Connection::getInstance();//数据库连接
        $route = Route::getInstance();//路由解析
        Session::getInstance();//session 开启
        Cookie::getInstance();//cookie开启
        Cache::getInstance();//缓存开启
        Dispatch::invokeMethod($route->getRoutearr());//路由分发
    }
}